
//
//  Vector_reverse.swift
//  SwiftyDSA
//
//  Created by Archer on 2018/8/9.
//  Copyright © 2018年 Archer. All rights reserved.
//

import Foundation

extension Vector {
    
    /// 反转向量
    public func reverse() {
        for i in 0..<(count / 2) { // 1 2 3 4
            (self[i], self[count - i - 1]) = (self[count - i - 1], self[i])
        }
    }
}
